/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "cex_nacionalidad_cultural")
@NamedQueries({
    @NamedQuery(name = "CexNacionalidadCultural.findAll", query = "SELECT c FROM CexNacionalidadCultural c")})
public class CexNacionalidadCultural implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "cnc_id")
    private Integer cncId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 64)
    @Column(name = "cnc_nombre")
    private String cncNombre;
    @Column(name = "cnc_codigo")
    private Integer cncCodigo;
    @OneToMany(mappedBy = "cexNacionalidadCultural", fetch = FetchType.LAZY)
    private List<CexHistoriaClinica> cexHistoriaClinicaList;

    public CexNacionalidadCultural() {
    }

    public CexNacionalidadCultural(Integer cncId) {
        this.cncId = cncId;
    }

    public CexNacionalidadCultural(Integer cncId, String cncNombre) {
        this.cncId = cncId;
        this.cncNombre = cncNombre;
    }

    public Integer getCncId() {
        return cncId;
    }

    public void setCncId(Integer cncId) {
        this.cncId = cncId;
    }

    public String getCncNombre() {
        return cncNombre;
    }

    public void setCncNombre(String cncNombre) {
        this.cncNombre = cncNombre;
    }

    public Integer getCncCodigo() {
        return cncCodigo;
    }

    public void setCncCodigo(Integer cncCodigo) {
        this.cncCodigo = cncCodigo;
    }

    public List<CexHistoriaClinica> getCexHistoriaClinicaList() {
        return cexHistoriaClinicaList;
    }

    public void setCexHistoriaClinicaList(List<CexHistoriaClinica> cexHistoriaClinicaList) {
        this.cexHistoriaClinicaList = cexHistoriaClinicaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cncId != null ? cncId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CexNacionalidadCultural)) {
            return false;
        }
        CexNacionalidadCultural other = (CexNacionalidadCultural) object;
        if ((this.cncId == null && other.cncId != null) || (this.cncId != null && !this.cncId.equals(other.cncId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.CexNacionalidadCultural[ cncId=" + cncId + " ]";
    }
    
}
